package com.liuugoqing.creator.builder.cat;

/**
 * 指挥者类
 * @Author : liugq
 * @Date : 2022/7/2 11:13
 * @See : 参考类
 * @Since： JDK1.8
 * @Version : 1.0
 */
public class Director {

    private Builder builder;

    /**
     * 指定要构建的 具体建造者类
     * @param builder
     */
    public Director(Builder builder){
        this.builder = builder;
    }

    /**
     * 构建具体产品
     * @return
     */
    public Bike construct(){
        builder.buildFrame();
        builder.buildSeat();
        return builder.createBike();
    }
}
